package network;

import com.jme3.network.Client;
import com.jme3.network.ClientStateListener;
import com.jme3.network.Message;
import com.jme3.network.MessageListener;

public class ClientListener implements ClientStateListener, MessageListener<Client> {

    public void clientConnected(Client c) {
	System.out.println("Connected.");
    }

    public void clientDisconnected(Client c, DisconnectInfo info) {
	System.out.println("Disconnected from server.");
    }

    public void messageReceived(Client source, Message message) {
	if(message instanceof StringMessage) {
	    System.out.println(((StringMessage)message).getMessage());
	}
    }
}
